#pragma once

#include <cstring>
#include <string>
#include <vector>

#include <iostream>


#include <string>
#include <vector>

namespace codewar {

class Kata
{
public:
	static std::vector<std::string> towerBuilder(int nFloors)
	{
		std::vector<std::string> x;
		for( auto step = 1; step <= nFloors; ++step ){
			x.push_back(std::string(2*nFloors - 1, ' ').replace(nFloors - step, 2*step - 1, 2*step - 1, '*' ));
		}
		return x;

	}

	static std::vector<std::string> towerBuilder2(int nFloors)
	{
		std::vector<std::string> tower(nFloors, std::string(2*nFloors - 1, ' '));
		for( auto count = 0; count < tower.size(); ++count ){
			tower[count].replace(nFloors - count - 1, 2*count + 1, 2*count + 1, '*' );
		}
		return tower;
	}

	static std::vector<std::string> towerBuilder3(int nFloors)
	{
		// set block
		const size_t max = 1024;
		char tower[max][2*max-1];

		// fill
		for( auto x = 0; x < nFloors; ++x ){
			std::memset(tower[x], 32, nFloors*2 - 1);
			std::memset(tower[x] + nFloors - x - 1 , 42, 2*x + 1);
		}

		// convert
		std::vector<std::string> towerVector;
		for( auto x = 0; x < nFloors; ++x ){
			towerVector.push_back(static_cast<std::string>(tower[x]));
		}
		
		return towerVector;
	}
	
};

}
